home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / PET / S-Super PET / (s)tj.d64 / FRAME.ASM < prev    next >
Assembly Source File  |  2009-01-18  |  3KB  |  138 lines

  1. opt     nolist
  2. xdef    screen_setup
  3. xref    putchar_,tputcurs_
  4.  
  5. line_length     equ     80
  6. crt_origin      equ     $8000
  7. null            equ     $00
  8. vertical_bar    equ     $01
  9. horizontal_bar  equ     $02
  10. right_bottom    equ     $03
  11. left_bottom     equ     $04
  12. left_top        equ     $05
  13. right_top       equ     $06
  14. cross_bar       equ     $0b
  15. blank           equ     $20
  16. clear_screen    equ     $0c
  17.  
  18. screen_setup    equ     *
  19.  
  20.         pshs    y,x,d
  21.  
  22.         ldb     #clear_screen
  23.         jsr     putchar_
  24.  
  25.         ldx     #crt_origin+2*line_length
  26.         jsr     top_line
  27.         jsr     box
  28.         jsr     box
  29.         jsr     box
  30.         jsr     bottom_line
  31.  
  32.         ldx     #text
  33.         loop
  34.                 ldd     ,x++
  35.         quif    eq
  36.  
  37.                 pshs    x
  38.                 jsr     tputcurs_
  39.                 puls    x
  40.  
  41.                 loop
  42.                         ldb     ,x+
  43.                 quif    eq
  44.                         pshs    x
  45.                         jsr     putchar_
  46.                         puls    x
  47.                 endloop
  48.         endloop
  49.  
  50.         puls    d,x,y
  51.  
  52.         rts
  53.  
  54. text    equ     *
  55.  
  56.         fcb     24,16
  57.         fcc     "RS 232C Communication Demonstration Program"
  58.         fcb     0
  59.  
  60.         fcb     25,22
  61.         fcc     "Written by Avygdor Moise, Oct 1983."
  62.         fcb     0
  63.  
  64.         fcb     4,6
  65.         fcc     "Current Setup :"
  66.         fcb     0
  67.  
  68.         fcb     5,21
  69.         fcc     "Baud rate   ="
  70.         fcb     0
  71.  
  72.         fcb     6,21
  73.         fcc     "Word length ="
  74.         fcb     0
  75.  
  76.         fcb     5,46
  77.         fcc     "Parity ="
  78.         fcb     0
  79.  
  80.         fcb     6,46
  81.         fcc     "Mode   ="
  82.         fcb     0
  83.  
  84.         fcb     7,1
  85.         fcc     "+12V"
  86.         fcb     0
  87.  
  88.         fcb     1,1
  89.         fcb     0
  90.  
  91.         fdb     $0000
  92.  
  93. line    equ     *       ;X=address where  , a=text,  b=count
  94.         loop
  95.                 sta     ,x+
  96.                 decb
  97.         until   eq
  98.         rts
  99.  
  100. top_line        equ     *       ;x=address where
  101.  
  102.         lda     #left_top
  103.         sta     ,x+
  104.  
  105.         lda     #horizontal_bar
  106.         ldb     #78
  107.         bsr     line
  108.  
  109.         lda     #right_top
  110.         sta     ,x+
  111.         rts
  112.  
  113. bottom_line     equ     *       ;x=address where
  114.  
  115.         lda     #left_bottom
  116.         sta     ,x+
  117.  
  118.         lda     #horizontal_bar
  119.         ldb     #78
  120.         bsr     line
  121.  
  122.         lda     #right_bottom
  123.         sta     ,x+
  124.         rts
  125.  
  126. box     equ     *       ;x=address where
  127.  
  128.         lda     #vertical_bar
  129.         sta     ,x+
  130.  
  131.         lda     #blank
  132.         ldb     #78
  133.         bsr     line
  134.  
  135.         lda     #vertical_bar
  136.         sta     ,x+
  137.         rts
  138.